package org.tarena.dang.dao.impl;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.tarena.dang.entity.CartItem;
import org.tarena.dang.entity.UserAdress;

public class testDao {
	static List<CartItem> buyItems = new ArrayList<CartItem>();
	public static void main(String[] args) throws SQLException {
		BookDAOImpl bookDAOImpl = new BookDAOImpl();
		CateGoryDAOImpl cateGoryDAOImpl = new CateGoryDAOImpl();
		OrderDAOImpl daoImpl = new OrderDAOImpl();
		//cateGoryDAOImpl.getCatsDetail("上课睡觉");
		bookDAOImpl.searchByKeyWords("上课睡觉");
		//cateGoryDAOImpl.searchByKeyWords("上课睡觉");
		//ResultSet re = pst.executeQuery();System.out.println(bookDAOImpl.findByCiddAll(10));
		UserAdress adress = new UserAdress();
		adress.setFullAddress("dadad");
		adress.setId(23);
		adress.setMobile("23424");
		adress.setPhone("24242");
		adress.setPostalCode("4242");
		adress.setReceiveName("zb");
		adress.setUserId(45);
		
		//System.out.println("+------"+daoImpl.saveOrder(63,adress, 342, 0, 24242442));
		daoImpl.getAddress(14);
		//daoImpl.saveOrder(id, address, count, waitPay, currentTimeMillis);
		//test();
	}
	
	public static void test(){
		
		CartItem cartItem = new CartItem();
		cartItem.setBuy(true);
		cartItem.setQty(12);
		CartItem cartItem1 = new CartItem();
		cartItem.setBuy(true);
		buyItems.add(cartItem);
		//cartItem.setBlance(14);
		buyItems.add(cartItem1);
		for(CartItem c:buyItems){
			
		}
		System.out.println(buyItems.size());;
	}
	
	public static void del(){
		for(CartItem c:buyItems){
			if(c.getQty()==12){
				c.setBuy(false);
				System.out.println("已经设置为false");
			}
		}
		System.out.println(buyItems.size());
	}
}
